<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Probably the most complete UI kit out there. Multiple functionalities and controls added,  extended color palette and beautiful typography, designed as its own extended version of Bootstrap at  the highest level of quality.                             ">
    <meta name="author" content="Webpixels">
    <title>评测系统</title>
    <!-- Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700,800|Roboto:400,500,700" rel="stylesheet">
    <!-- Theme CSS -->
    <link type="text/css" th:href="@{/css/theme.css}" rel="stylesheet">
    <link type="text/css" th:href="@{/scss/evaluation.css}" rel="stylesheet">
  </head>
  <body>
    <div th:replace="~{common/header :: header}"></div>
    <main class="main">
      <section class="slice slice-lg">
        <div class="container d-flex align-items-center no-padding">
            <div class="col" style="overflow-x: scroll">
              <form style="text-align: center" method="post" th:action="${#servletContext.contextPath + '/task/do'}">
                <input type="hidden" name="taskId" th:value="${#request.getParameter('taskId')}">
                <table border="1" bordercolor="#ccc" style="min-width: 800px;" class="eval-table table-hover">
                  <thead>
                  <tr>
                    <th scope="col">评价节点</th>
                    <th scope="col">评测指标</th>
                    <th scope="col">评测内容</th>
                    <th scope="col">评分</th>
                  </tr>
                  </thead>
                  <tbody>
                  <div th:each="node, status : ${evaluationNodeVOS}">
                    <tr>
                      <td th:text="${node.nodeType+'('+node.nodeTech+')'}" th:rowspan="${node.rowSpanCount}">知识攒底</td>
                      <td th:text="${#arrays.length(node.nodeTypeItems) > 0 ? node.nodeTypeItems[0].nodeTypeName : ''}" th:rowspan="${#arrays.length(node.nodeTypeItems[0].nodeItems)}"></td>
                      <td th:text="${#arrays.length(node.nodeTypeItems) > 0 && #arrays.length(node.nodeTypeItems[0].nodeItems) > 0 ? node.nodeTypeItems[0].nodeItems[0].nodeItemContent : ''}"></td>
                      <td>
                        <select name="doItems">
                          <option value="">请选择</option>
                          <option th:each="score : ${#numbers.sequence(node.nodeTypeItems[0].nodeItems[0].scoreMaxLimit, 1)}"
                                  th:value="${node.nodeTypeItems[0].nodeItems[0].nodeItemId + '-' + score}" th:text="${score}">
                          </option>
                        </select>
                      </td>
                    </tr>
                    <div th:if="${#arrays.length(node.nodeTypeItems) > 1}" th:each="typeNode, status1 : ${node.nodeTypeItems}">
                      <div th:if="${status1.index == 0}">
                        <tr th:if="${status2.index != 0}" th:each="nodeItem, status2 : ${typeNode.nodeItems}">
                          <td th:text="${nodeItem.nodeItemContent}"></td>
                          <td>
                            <select name="doItems">
                              <option value="">请选择</option>
                              <option th:each="score : ${#numbers.sequence(nodeItem.scoreMaxLimit, 1)}"
                                      th:value="${nodeItem.nodeItemId + '-' + score}" th:text="${score}">
                              </option>
                            </select>
                          </td>
                        </tr>
                      </div>
                      <div th:if="${status1.index != 0}">
                        <tr>
                          <td th:rowspan="${#arrays.length(typeNode.nodeItems)}" th:text="${typeNode.nodeTypeName}"></td>
                          <td th:text="${#arrays.length(typeNode.nodeItems) > 0 ? typeNode.nodeItems[0].nodeItemContent : ''}"></td>
                          <td>
                            <select name="doItems">
                              <option value="">请选择</option>
                              <option th:each="score : ${#numbers.sequence(typeNode.nodeItems[0].scoreMaxLimit, 1)}"
                                      th:value="${typeNode.nodeItems[0].nodeItemId + '-' + score}" th:text="${score}">
                              </option>
                            </select>
                          </td>
                        </tr>
                        <tr th:if="${#arrays.length(typeNode.nodeItems) > 1 && status2.index != 0}" th:each="nodeItem, status2 :${typeNode.nodeItems}">
                          <td th:text="${nodeItem.nodeItemContent}"></td>
                          <td>
                            <select name="doItems">
                              <option value="">请选择</option>
                              <option th:each="score : ${#numbers.sequence(nodeItem.scoreMaxLimit, 1)}"
                                      th:value="${nodeItem.nodeItemId + '-' + score}" th:text="${score}">
                              </option>
                            </select>
                          </td>
                        </tr>
                      </div>
                    </div>
                  </div>
                  </tbody>
                </table>
                <input class="btn btn-secondary" type="submit" style="margin: 25px 0" value="提交">
              </form>
            </div>
        </div>
      </section>
    </main>
    <div th:replace="~{common/footer :: footer}"></div>
  </body>
</html>
